//
//  Sensor.h
//  SujetObserver
//
//  Created by Pierre DUCHENE on 05/01/10.
//  Copyright 2010 Pierre DUCHENE. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SensorProtocol.h"
#import "SubjectProtocol.h"
#import "SpreadProtocol.h"
#import "ContextProtocol.h"

@class SensorData;

/*!
    @class       TemperatureSensor 
    @superclass  NSObject <SensorProtocol,SubjectProtocol,ContextProtocol>
    @abstract    This class represent an sensor but also a subject for Observer Pattern and the context for Strategy Pattern
    @discussion  This object contain a data which may modified and then notify all this observers.
				 As context, a strategy can call this object to get some usefull information
*/
@interface TemperatureSensor : NSObject <SensorProtocol,SubjectProtocol,ContextProtocol> {
	// Observing Part
	NSMutableSet* observers;
	
	// Data management Part
	SensorData* sensorData;
	
	// Spread Strategy Part
	id<SpreadProtocol> spreadStrategy;
}

@property (retain) id<SpreadProtocol> spreadStrategy;

- (void)setSensorValue:(NSNumber*)newValue;

@end
